package cn.openea.perpartner.meily.web.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.openea.perpartner.meily.web.mapper.OperLogMapper;
import cn.openea.perpartner.meily.web.entity.OperLog;
import cn.openea.perpartner.meily.web.service.IOperLogService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * 操作日志记录(OperLog)表服务实现类
 *
 * @author Weird077
 * @since 2023-03-21 12:44:29
 */
@Slf4j
@Service("operLogService")
public class OperLogServiceImpl extends ServiceImpl<OperLogMapper, OperLog> implements IOperLogService {
    final String uri = "/goods/get/";
    @Override
    public long queryProductClicks(String productNum) {
        LambdaQueryWrapper<OperLog> wrapper = new LambdaQueryWrapper<>();
        wrapper.likeRight(OperLog::getOperUrl, uri.concat(productNum));
        return count(wrapper);
    }
}

